package com.chenshu.controller;

import com.chenshu.domain.Order;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2024-04-29
 * Time：14:36
 */
@Controller
public class OrderController {
    @GetMapping("/order")
    public String showOrder(HttpServletRequest request) {
        Order order = new Order();
        order.setOrderTime(new Date());
        order.setNum(9999999);
        order.setPrice(123.4567);
        order.setDiscount(0.88888);
        request.setAttribute("order", order);
        return "order";
    }
}
